/*

Author   : chaos

FileName : out_fun.cpp

Date     : 16/08/17 10:06:49

*/
#include <iostream>
using namespace std;

#define size 10

int main(int argc ,char *argv[])
{
    char ch ,str[size];

    cout << "Please input a char :" << endl;
    cin.get(ch);
    cout << "Getting a char with cin.get() :" << endl;
    cout << ch << endl;

    cout << "Please input a string :" << endl;
    cin >> str;
    cout << "Getting a string with operator >> :" << endl;
    cout << str << endl;

    cin.get(str,size);
    cout << "Getting a string  with cin.get() :" << endl;
    cout << str << endl;

    cin.ignore(10,'\n');
    cout << "Please input a string :" << endl;
    cin.getline(str,size,'\n');

    cout << "Getting a string with cin.getline() :" << endl;
    cout << str << endl;
    cout << cin.gcount() << "chars in string." << endl;
    return 0;
}
